#include <assert.h>
#include <stdio.h>

//1.
int my_strlen1(const char*str)
{
    int count = 0;
    while(*str)
    {
        count++;
        str++;
    }
    return count;
}

int my_strlen2(const char*str)
{
    if(*str=='\0')
        return 0;
    return 1+my_strlen2(str+1);
}

int my_strlen3(char*s)
{
    char*p = s;
    while (*p!='\0')
        p++;
    return p-s;
}

//2.
char *my_strcpy(char*dest,const char*src)
{
    char*ret = dest;
    assert(dest!=NULL);
    assert(src!=NULL);
    while ((*dest++ = *src++))
    {
        ;
    }
    return ret;
}
